﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Milo.Tests.Mock.Controls
{
    using Framework;

	public class HierTypeControl : ListControl<HierType>, IListControl<HierType>
	{
		#region constructors
		public HierTypeControl() { }
		public HierTypeControl(HierType model) : base(model) { }
		public HierTypeControl(string name, HierType model) : base(name, model) { }
		#endregion

		#region model properties as controls
		private SimpleTypeControl simpleObject;

		public SimpleTypeControl SimpleObject
		{
			get
			{
				if (simpleObject == null)
				{
					simpleObject = new SimpleTypeControl();
					simpleObject.LinkToParent("SimpleObject", this, get_SimpleObject_value, set_SimpleObject_value, 0);
				}
				return simpleObject;
			}
		}
		#endregion

		#region getters and setters
		private SimpleType get_SimpleObject_value(int index) { return Value.SimpleObject; }
		private void set_SimpleObject_value(SimpleType value, int index) { Value.SimpleObject = value; }
		#endregion
	}
}
